package com.accgm.api.main;

import org.restlet.Application;
import org.restlet.Restlet;
import org.restlet.routing.Router;

import com.accgm.api.resources.test.TestApi;
import com.accgm.api.resources.user.LoginResource;
import com.accgm.api.resources.user.UpdateUserPasswordResource;
import com.accgm.api.resources.user.UpdateUserResource;
import com.accgm.api.resources.user.UserRegisterResource;
import com.accgm.api.resources.user.message.UploadDocumentResource;
import com.accgm.api.resources.user.message.UserMessageAddResource;

public class QinQinClientApplication extends Application {

	public Restlet createInboundRoot() {
		Router router = new Router(getContext());
		this.oauth(router);
		return router;
	}

	private void oauth(Router router) {
		// 个人测试
		router.attach("/testApi", TestApi.class);
		//注册账号
		router.attach("/userRegister",UserRegisterResource.class);
		//登录
		router.attach("/login",LoginResource.class);
		//更新账号
		router.attach("/updateUser",UpdateUserResource.class);
		//上传文件
		router.attach("/uploadDocument",UploadDocumentResource.class);
		//上传采集数据
		router.attach("/userMessageAdd",UserMessageAddResource.class);
		//修改用户密码
		router.attach("/updateUserPassword",UpdateUserPasswordResource.class);
	}
}
